package com.twu.biblioteca.memberdata;

/**
 * Created with IntelliJ IDEA.
 * User: Maximilian
 * Date: 1/10/13
 * Time: 1:24 PM
 * To change this template use File | Settings | File Templates.
 */
public class Member {
    String id;
    String password;
    String email;

    public Member(String i, String e, String p)
    {
        id = i;
        password = p;
        email = e;
    }

    public String getId()
    {
        return id;
    }

    public String getPassword()
    {
        return password;
    }

    public String getEmail()
    {
        return email;
    }

    public boolean equals(Object o)
    {
        if(o instanceof Member)
        {
            Member other = (Member)o;
            return id.equals(other.id) && password.equals(other.password) && email.equals(other.email);
        }
        return false;
    }

    public int hashCode()
    {
        return id.hashCode() + password.hashCode() + email.hashCode();
    }

    public String toString()
    {
        return "Username: " + getId() + ", Password: " + getPassword() + ", Email: " + getEmail();
    }
}
